package cn.woflcode.game.Global;

import cn.woflcode.game.view.GameFrame;

import java.awt.image.BufferedImage;

public class Global {
    public static final int GAME_UI_WIDTH=650;
    public static final int GAME_UI_HEIGHT=970;
    //当前的游戏状态，初始状态设置为状态
    public static GameState currentstate = GameState.READY;
    //定义一个内部枚举类
    public  enum GameState{
        READY,  //准备状态
        RUNNING,//运行状态
        PAUSE,  //暂停状态
        STOP;   //结束状态
        //返回不同状态对应的图片
        public BufferedImage getImage() {
            if (currentstate == GameState.READY) {
                return ImageUtil.getImage("game_ready");
            } else if (currentstate == GameState.PAUSE) {
                return ImageUtil.getImage("game_pause");
            } else {
                return ImageUtil.getImage("game_stop");
            }

        }

    }
    //飞行物的生命状态
    public enum FlyObjectState {
        ALIVE, //存活
        DEATH,  //死亡  敌机拥有
        DELETABLE; //可删除，生命数为0的时候 状态DEATH->DELETABLE
    }
}
